<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix="c" uri="/WEB-INF/tlds/hdiv-c.tld"%>
<%@ taglib prefix="form" uri="/WEB-INF/tlds/hdiv-spring-form-3_0_4.tld"%>
<%@ taglib prefix="spring" uri="/WEB-INF/tlds/hdiv-spring.tld" %>
<%@ taglib prefix="display" uri="http://displaytag.sf.net" %>

<c:url value="mostrarHWF3011.html" var="consolidadocuentas"/>

<script type="text/javascript">

function show_loading(){  
    var loadingAnim = document.getElementById('loading_mostrar');  
    loadingAnim.innerHTML = '<img src="imagenes/logoProcesandoDown.gif" width=' + xx_d + 'height=' + yy_d + 'alt="Procesando" />';  
    loadingAnim.style.display = 'block';      
    }  

$("form").ready(function(){
    loadModulos();
    $("input[type=checkbox]").click(loadModulos);
    $("#fechaProceso").datepicker();
});
function loadModulos(){
    var values = $('input:checkbox:checked').map(function () { 
      return this.value; 
    }).get(); 
    $.getJSON("getJSON.html", {accion : "getListModulosByCntas", cuentas: values.join(",") },function(listModulos){
        var options = '<option value="">Seleccione'+'</'+'option>';
        for (var i = 0; i < listModulos.length; i++) {
            options += '<option value="' + listModulos[i].codBoveda + '">' + listModulos[i].descripcion+'</'+'option>';
        }
        $("#modulo").html(options);
        $('#modulo option:first').attr('selected', 'selected');
    });
}

function cursor_wait() {
      document.body.style.cursor = 'wait';
    }
    
function mostrar(){
    if (document.forms[0].modulo.value=='' ) {
        alert('Debe seleccionar el modulo.');
        return false;
    }
    if (document.forms[0].fechaProceso.value=='' ) {
        alert('Debe ingresar la fecha de proceso.');
        return false;
    }
    //activar el div procesando con javascript
      show_loading();
      setTimeout('show_loading();', 1000);
      cursor_wait() ;
       //////
    moveForward('mostrar');    
}

function selCuenta(){
    moveForward('selCuenta');
}
</script>

<style type="text/css">  
<!-- 
#loading_mostrar {display:none;}  
-->  
</style> 

<form:form modelAttribute="form" action="${consolidadocuentas}">
<form:hidden path="control"/>
<form:hidden path="accion"/>

<table id="fullheighttable" width="775" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td align="left" valign="top" class="fondo_contenido padtop16left21">
      <table border="0" cellspacing="0" cellpadding="0" class="verdana11bazul">
      <tr>
        <td height="22" align="left" valign="top" class="verdana11bazul">
		<ul class="navlist2">
		<li>CONSOLIDADO DE CUENTAS</li>
		</ul>
        </td>
      </tr>
      <tr>
        <td align="left" valign="top" class="borde_totalblanco"><table border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="100" height="23" align="left" valign="top" class="verdana10bazul">Cliente</td>
            <td height="23" align="left" valign="top" class="verdana10negro"
                width="416">
                <c:out value="${sessionScope.nombreCliente}"/>
               </td>
          </tr>
   
          <tr>
            <td width="100" height="27" align="left" valign="top" class="verdana10bazul">Cuentas</td>
            <td height="27" align="left" valign="bottom" class="verdana10negro" width="416">
                <div class="navlist2">                       
                <c:forEach items="${listaCuentas}" var="cuentasSel" varStatus="status">
                    <form:checkbox path="cuentasSelecc" value="${cuentasSel.numero}"/><c:out value="${cuentasSel.descripcion}"/><br>
                </c:forEach>
            </div></td>

         </tr>
         <tr>
            <td width="100" height="34" align="left" valign="bottom" class="verdana10bazul">M&oacute;dulo</td>
            <td height="34" align="left" valign="bottom" class="verdana10negro"
                width="416">
            <form:select cssStyle="height: 20px; width: 180px; font-family: Arial; font-size: 8pt"
                        path="modulo">
                <form:option value="">Seleccione</form:option>                
                <form:options items="${listaModulo}"
                            itemValue="codBoveda"
                            itemLabel="descripcion"/>
            </form:select></td>
         </tr>
          
         <tr>
            <td height="34" align="left" valign="bottom" class="verdana10bazul"
                width="100">Fecha Proceso</td>
            <td height="34" align="left" valign="bottom" class="verdana10negro"
                width="416">
            <table border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td align="center" valign="bottom" class="padright10"><div class="fondo_txtbox90">
                       <form:input maxlength="10" size="12" path="fechaProceso"/>
                        </div></td>
                  <td class="verdana10bazul" align="right">&nbsp;</td>
                  <td align="center" valign="middle"></td>
                  <td width="140" align="right" valign="middle">
                    <input name="Submit2" type="button" class="boton" value="Mostrar" onclick="javascript:mostrar();">
                  </td>
                </tr>
            </table></td>
          </tr>          
          
        </table>
        </td>
      </tr>
          <tr>
                <td colspan="2" align="center">    
                <div id="loading_mostrar"><img id="logoDown" src="imagenes/logoProcesandoDown.gif" alt="Procesando" /></div>  
                </td>
         </tr> 
      </table>
    <c:if test="${not empty listaDenominacion}">
      <table border="0" cellpadding="0" cellspacing="0" class="margintop20">
        <tr >
          <td width="100%">
              <display:table id="lista" name="listaDenominacion" cellpadding="0"
                             cellspacing="0" style="width:100%" pagesize="15"
                             export = "true"                           
                             requestURI="${consolidadocuentas}"
                             class="its">
               <tbody>
                <display:column property="desTipo"
                                headerClass="even" class="even "
                                title="Tipo"/>
                <display:column property="valor"
                                headerClass="even" class="cellderecha "
                                title="Denominacion"/>
                <display:column property="saldo1"
                                headerClass="even" class="cellderecha "
                                title="Movimiento"/>
                <display:column property="saldo2"
                                headerClass="even" class="cellderecha "
                                title="Limpio"/>                
                <display:column property="saldo3"
                                headerClass="even" class="cellderecha "
                                title="Deteriorado"/>
                <display:column property="saldo4"
                                headerClass="even" class="cellderecha "
                                title="ATM"/>
                <display:column property="saldo5"
                                headerClass="even" class="cellderecha "
                                title="CB"/>
                <display:column property="total2"
                                headerClass="even" class="cellderecha "
                                title="Totales"/>
               </tbody>
              </display:table>
          </td>
        </tr>
        <tr><td>&nbsp;</td>
        </tr>
        <tr><td>
        <table width="100%" border="0" cellpadding="0" cellspacing="0" class="its">
        <tbody>
        <tr class="even2">
            <td width="13%">&nbsp;</td>
            <td width="13%">Totales:</td>
            <td width="12%">
                <c:if test="${not empty suma1}" >
                    <c:out value="${suma1}"/>
                </c:if>
            </td>
            <td width="12%">
                <c:if test="${not empty suma2}" >
                    <c:out value="${suma2}"/>
                </c:if>
            </td>
            <td width="12%">
                <c:if test="${not empty suma3}" >
                    <c:out value="${suma3}"/>
                </c:if>
            </td>
            <td width="12%">
                <c:if test="${not empty suma4}" >
                    <c:out value="${suma4}"/>
                </c:if>
            </td>
            <td width="13%">
                <c:if test="${not empty suma5}" >
                    <c:out value="${suma5}"/>
                </c:if>
            </td>
            <td width="13%">
                <c:if test="${not empty sumaT}" >
                    <c:out value="${sumaT}"/>
                </c:if>
            </td>
        </tr>
        </tbody>
        </table>
        </td>
        </tr>
        <tr><td><table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tbody>
        <tr>
            <td width="16%" align="left" class="verdana11bazul">
                Remesas por procesar:
            <td width="21%" align="center" class="verdana11bazul">
                <c:if test="${not empty cantidadT}" >
                    <c:out value="${cantidadT}"/>
                </c:if>
            </td>
            <td width="15%" align="left" class="verdana11bazul">
                    Monto por procesar:
            <td width="20%" align="center" class="verdana11bazul">
                <c:if test="${not empty totalT}" >
                    <c:out value="${totalT}"/>
                </c:if>
            </td>
            <td width="10%" align="left" class="verdana11bazul">
                Total Saldo:
            <td width="18%" align="center" class="verdana11bazul">
                <c:if test="${not empty totalS}" >
                    <c:out value="${totalS}"/>
                </c:if>
            </td>
        </tr>
        </tbody>
        </table></td></tr>
        <tr><td>
        <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tbody>
        </tbody>
        </table>
        </td>
        </tr>
      </table>
    </c:if>
</td>
  </tr>
</table>
</form:form> 

